package com.JSON;

import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;

import java.lang.reflect.Type;

/**
 * Created by mk on 2017/11/24.
 */

public class MyJsonUtil {

    public static final <T> T parseObject(String text, Class<T> clazz) {
//        return new Gson().fromJson(text,clazz);
        return JSON.parseObject(text,clazz);
    }

    public static final <T> T parseObject(String text, Type type) {
        Gson gson = new Gson();
        T netBean = gson.fromJson(text, type);
        return netBean;
    }
}
